var pbdtool = function () {
	var prefManager = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
	return {
		init : function () {
			gBrowser.addEventListener("load", function () {
			}, false);
		},
		record : function () {
			var pageDocument = window.content.document;
				
			if (pageDocument) {
				alert("1");
				var oDoc = $(window.content.document);
				alert(oDoc);
				var oDiv = oDoc.('#pbdtool-eventts-div');
				alert("2");
				if (!oDiv) {
					alert("3");
					$(window.content.document).append("<div id='pbdtool-events-div'><p id='pbdtool-events-p'>Meu teste</p></div>");
					alert("4");
					oDiv = $(window.content.document).('#pbdtool-eventts-div');
					alert("5");
					/*var oP=pageDocument.createElement("P");
					var oText = pageDocument.createTextNode("ANDRE NETO");
					oP.appendChild(oText);
					pageDocument.body.appendChild(oP);  */
				}
				oDiv.dialog();
				alert("6");
			}

		},
		stop : function () {
			alert("Stop");
		},
		play : function () {
			alert("Play");
		}
	};
}();
window.addEventListener("load", pbdtool.init, false); 